<?php

namespace App\Logic;

use App\common;
use App\Models\BackAdmin;
use App\Models\Admin;
use App\Models\Borker;
use App\Models\Fang;
use Dflydev\DotAccessData\Data;
use http\Exception\RuntimeException;
use Illuminate\Support\Facades\Hash;

class BrokerLogic
{
    /**
     * @name  wl
     * @return mixed
     */
    public static function show()
    {
        return Admin::show();
    }


    /**
     *
     * @param $id
     * @return int
     */
    public static function del($id)
    {
        if (empty($id)) throw  new \RuntimeException('参数为空');
        $brokerDel = Admin::del('id', $id);
        return $brokerDel;
    }

    /**
     * @function 搜索数据
     * @param $data
     * @return mixed
     */
    public static function searchFunction($data)
    {
        if (empty($data)) {
            return Admin::show();
        }
        $backSearch = Admin::search('name', $data);
        return $backSearch;
    }
}
